package cn.lut.springboot.handler;

import cn.lut.springboot.api.EmployeeRemoteService;
import cn.lut.springboot.entity.Employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @user:dell
 * @date:2021年01月06 11:07
 */
@RestController
public class EmployeeFeignHandler {
//    装配调用远程微服务的接口，后面就像调用本地方法一样直接使用
    @Autowired
    private EmployeeRemoteService employeeRemoteService;
    @RequestMapping("/feign/consumer/get/emp")
    public Employee getEmployeeRemote(){
        return employeeRemoteService.getEmployeeRemote();
    }
    @RequestMapping("/provider/get/employee/by/id")
      public List<Employee> getEmpListRemote(String keyword){
        return employeeRemoteService.getEmpListRemote(keyword);
    };
}
